home *** CD-ROM | disk | FTP | other *** search
- global current, hoff, hpos, hcol, msprite, fsprite, hspace, datecast, spriteorder, keydates, lasthl, cdvar, bigskip, currentmin, currentmax
-
- on startMovie
- setupdatevars()
- setupdummydates()
- end
-
- on setupmenu
- set fsprite to 9
- set bigskip to 28
- set datecast to the number of member "datecast"
- set spriteorder to [0, 1, 2, 3, 4, 5]
- set current to 1
- set currentmin to 1
- set currentmax to 2557
- repeat with j = 1 to 6
- puppetSprite(fsprite + j, 1)
- set the text of cast (datecast + (j - 1)) to finddate(mygetat(keydates, current + (j - 3)))
- set the foreColor of member (datecast + (j - 1)) to 0
- end repeat
- set lasthl to datecast + 2
- set the foreColor of member lasthl to 5
- set hoff to 0
- set hspace to 128
- updateStage()
- end
-
- on redisplaydates
- if cdvar then
- repeat with j = 1 to 6
- set the text of cast (datecast + getAt(spriteorder, j)) to finddate(mygetat(keydates, current + (bigskip * (cdvar * (j - 3)))))
- end repeat
- else
- repeat with j = 1 to 6
- set the text of cast (datecast + getAt(spriteorder, j)) to finddate(mygetat(keydates, current + (j - 3)))
- end repeat
- end if
- updateStage()
- end
-
- on scrolldates
- if lasthl <> 0 then
- set the foreColor of member lasthl to 0
- set lasthl to 0
- end if
- set STEP to 20
- set range to 100
- set baseH to the mouseH
- repeat while the stillDown
- set TMPH to the mouseH
- set TMPH to TMPH - baseH
- if TMPH <> 0 then
- set X to -TMPH / 5
- if X > 48 then
- set X to 48
- else
- if X < -48 then
- set X to -48
- end if
- end if
- end if
- if moveposs(X) then
- displaydates(X)
- end if
- end repeat
- updateStage()
- end
-
- on mywait val
- global lasttime
- repeat while the ticks < (lasttime + val)
- end repeat
- set lasttime to the ticks
- end
-
- on findclosest
- set sofar to 1000
- repeat with j = 1 to 6
- set dist to abs(320 - (the locH of sprite (10 + (j - 1)) + 64))
- if dist <= sofar then
- set sofar to dist
- set cnum to j - 1
- end if
- end repeat
- return cnum
- end
-
- on lockondates
- set closest to findclosest()
- set p1 to the locH of sprite (10 + closest) + 64
- if p1 > 320 then
- set tdist to p1 - 320
- set tmpdist to tdist
- repeat while tmpdist <> 0
- set scrollval to tmpdist / 5
- if scrollval < 1 then
- set scrollval to 1
- end if
- displaydates(-scrollval)
- set tmpdist to tmpdist - scrollval
- end repeat
- else
- if p1 < 320 then
- set tdist to 320 - p1
- set tmpdist to tdist
- repeat while tmpdist <> 0
- set scrollval to tmpdist / 5
- if scrollval < 1 then
- set scrollval to 1
- end if
- displaydates(scrollval)
- set tmpdist to tmpdist - scrollval
- end repeat
- else
- autoclick()
- end if
- end if
- set closest to findclosest()
- set lasthl to datecast + closest
- set the foreColor of member lasthl to 5
- updateStage()
- end
-
- on autoclick
- set tclickpt to the clickLoc
- set tclick to getAt(tclickpt, 1)
- if tclick > 512 then
- set scdir to -2
- else
- if tclick > 384 then
- set scdir to -1
- else
- if tclick < 128 then
- set scdir to 2
- else
- if tclick < 256 then
- set scdir to 1
- end if
- end if
- end if
- end if
- if movepossauto(scdir) then
- set tdist to 128
- set tmpdist to tdist
- repeat while tmpdist <> 0
- set scrollval to tmpdist / 5
- if scrollval < 1 then
- set scrollval to 1
- end if
- displaydates(scrollval * scdir)
- set tmpdist to tmpdist - scrollval
- end repeat
- set closest to findclosest()
- set lasthl to datecast + closest
- set the foreColor of member lasthl to 5
- updateStage()
- end if
- end
-
- on movepossauto dir
- if cdvar then
- if dir > 0 then
- if (current - bigskip - ((dir - 1) * bigskip)) >= currentmin then
- return 1
- else
- return 0
- end if
- else
- if dir < 0 then
- if (current + bigskip + ((abs(dir) - 1) * bigskip)) <= currentmax then
- return 1
- else
- return 0
- end if
- end if
- end if
- else
- if (((current - (dir - 1)) > currentmin) and (dir > 0)) or (((current + (abs(dir) - 1)) < currentmax) and (dir < 0)) then
- return 1
- else
- return 0
- end if
- end if
- end
-
- on moveposs dir
- if cdvar then
- if dir > 0 then
- if (current - bigskip) > currentmin then
- return 1
- else
- return 0
- end if
- else
- if dir < 0 then
- if (current + bigskip) < currentmax then
- return 1
- else
- return 0
- end if
- end if
- end if
- else
- if ((current > currentmin) and (dir > 0)) or ((current < currentmax) and (dir < 0)) then
- return 1
- else
- return 0
- end if
- end if
- end
-
- on displaydates factor
- if factor < 0 then
- if the locH of sprite (fsprite + 1 + getAt(spriteorder, 1)) <= -126 then
- set the locH of sprite (fsprite + 1 + getAt(spriteorder, 1)) to the locH of sprite (fsprite + 1 + getAt(spriteorder, 1)) + 640 + 128
- switchorder(1)
- end if
- else
- if factor > 0 then
- if the locH of sprite (fsprite + 1 + getAt(spriteorder, 6)) >= 640 then
- set the locH of sprite (fsprite + 1 + getAt(spriteorder, 6)) to the locH of sprite (fsprite + 1 + getAt(spriteorder, 6)) - 640 - 128
- switchorder(0)
- end if
- end if
- end if
- repeat with j = 1 to 6
- set spriteloch to the locH of sprite (fsprite + 1 + getAt(spriteorder, j))
- set spriteloch to spriteloch + factor
- set the locH of sprite (fsprite + 1 + getAt(spriteorder, j)) to spriteloch
- end repeat
- mywait(1)
- updateStage()
- end
-
- on switchorder right
- if right then
- set tmp to getAt(spriteorder, 1)
- repeat with j = 1 to 5
- setAt(spriteorder, j, getAt(spriteorder, j + 1))
- end repeat
- setAt(spriteorder, 6, tmp)
- if cdvar then
- set current to current + bigskip
- set the text of cast (datecast + getAt(spriteorder, 6)) to finddate(mygetat(keydates, current + (3 * bigskip)))
- else
- set current to current + 1
- set the text of cast (datecast + getAt(spriteorder, 6)) to finddate(mygetat(keydates, current + 3))
- end if
- else
- set tmp to getAt(spriteorder, 6)
- repeat with j = 6 down to 2
- setAt(spriteorder, j, getAt(spriteorder, j - 1))
- end repeat
- setAt(spriteorder, 1, tmp)
- if cdvar then
- set current to current - bigskip
- set the text of cast (datecast + getAt(spriteorder, 1)) to finddate(mygetat(keydates, current - (2 * bigskip)))
- else
- set current to current - 1
- set the text of cast (datecast + getAt(spriteorder, 1)) to finddate(mygetat(keydates, current - 2))
- end if
- end if
- end
-
- on mygetat var, pos
- if (pos < currentmin) or (pos > currentmax) then
- return 0
- else
- return getAt(var, pos)
- end if
- end
-